home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / ccd0605.iso / Software / Freeware / Programare / highlight / highlight-W32GUI-2.2-10b-Setup.exe / {app} / src / documentstyle.h < prev    next >
C/C++ Source or Header  |  2004-10-20  |  4KB  |  128 lines

  1. /***************************************************************************
  2.                           documentstyle.h  -  description
  3.                              -------------------
  4.     begin                : Son Nov 10 2002
  5.     copyright            : (C) 2002 by Andre Simon
  6.     email                : andre.simon1@gmx.de
  7.  ***************************************************************************/
  8.  
  9. /***************************************************************************
  10.  *                                                                         *
  11.  *   This program is free software; you can redistribute it and/or modify  *
  12.  *   it under the terms of the GNU General Public License as published by  *
  13.  *   the Free Software Foundation; either version 2 of the License, or     *
  14.  *   (at your option) any later version.                                   *
  15.  *                                                                         *
  16.  ***************************************************************************/
  17.  
  18. #ifndef DOCUMENTSTYLE_H
  19. #define DOCUMENTSTYLE_H
  20.  
  21. #include <string>
  22. #include <iostream>
  23. #include "configurationreader.h"
  24. #include "elementstyle.h"
  25. #include "stylecolour.h"
  26.  
  27. using namespace std;
  28.  
  29. namespace highlight {
  30.  
  31. /** maps keyword class names and the corresponding formatting information*/
  32. typedef map <string, ElementStyle*> KeywordStyles;
  33.  
  34. /** iterator for keyword styles*/
  35. typedef KeywordStyles::iterator KSIterator;
  36.  
  37. /** \brief Contains information about document formatting properties.
  38.  
  39. * @author Andre Simon
  40. */
  41.  
  42. class DocumentStyle
  43.   {
  44.   private:
  45.     ElementStyle comment, slcomment, str, dstr,
  46.                  escapeChar, number, directive, line, symbol;
  47.     ElementStyle defaultElem;
  48.     StyleColour  bgColour;
  49.  
  50.     string fontsize;
  51.     bool fileFound;
  52.  
  53.     KeywordStyles keywordStyles;
  54.  
  55.   public:
  56.     /** Constructor
  57.         \param styleDefinitionPath Style definition path */
  58.     DocumentStyle(const string & styleDefinitionPath);
  59.     DocumentStyle();
  60.     ~DocumentStyle();
  61.  
  62.   /** load sytle definition
  63.         \param styleDefinitionFile Style definition path
  64.         \return True if successfull */
  65.     bool load(const string & styleDefinitionFile);
  66.  
  67.     /** \return class names defined in the theme file */
  68.     vector <string> getClassNames();
  69.  
  70.     /** \return keyword styles */
  71.     KeywordStyles& getKeywordStyles();
  72.  
  73.     /** \return Font size */
  74.     string &getFontSize() ;
  75.  
  76.     /** \return Background colour*/
  77.     StyleColour& getBgColour();
  78.  
  79.     /** \return Style of default (unrecognized) strings */
  80.     ElementStyle & getDefaultStyle() ;
  81.  
  82.     /** \return Comment style*/
  83.     ElementStyle & getCommentStyle() ;
  84.  
  85.     /** \return Single line comment style*/
  86.     ElementStyle& getSingleLineCommentStyle() ;
  87.  
  88.     /** \return Keyword style*/
  89.     ElementStyle & getKeywordStyle() ;
  90.  
  91.     /** \return String style*/
  92.     ElementStyle & getStringStyle() ;
  93.  
  94.     /** \return Directive line string style*/
  95.     ElementStyle & getDirectiveStringStyle() ;
  96.  
  97.     /** \return Escape character style*/
  98.     ElementStyle & getEscapeCharStyle() ;
  99.  
  100.     /** \return Number style*/
  101.     ElementStyle & getNumberStyle() ;
  102.  
  103.     /** \return Directive style*/
  104.     ElementStyle & getDirectiveStyle() ;
  105.  
  106.     /** \return Type style*/
  107.     ElementStyle & getTypeStyle() ;
  108.  
  109.     /** \return Line number style*/
  110.     ElementStyle & getLineStyle() ;
  111.  
  112.     /** \return Bracket style*/
  113.     ElementStyle & getSymbolStyle() ;
  114.  
  115.     /**
  116.        \param className Name of keyword class
  117.        \return keyword style of the given className
  118.     */
  119.     ElementStyle & getKeywordStyle(const string &className);
  120.  
  121.     /** \return True if language definition was found */
  122.     bool found() const ;
  123.   };
  124.  
  125. }
  126.  
  127. #endif
  128.